
import  {baseUrl} from './base.js'
export const request = (params)=>{
	return new Promise(function(resolve,reject){
		uni.showLoading({
			mask:true,
			title:'正在加载中'
		})
		uni.request({
			...params,
			url:baseUrl+ params.url,
			header:{
				Authorization:uni.getStorageSync('token')
			},
			success:(res)=>{
				resolve(res)
			},
			fail:(err)=>{
				 reject(err)
			},
			complete:()=>{
				uni.hideLoading()
			}
		})
	})
}